//
//  HTTPTool.h
//  GentlemanAnime
//
//  Created by dlios on 15-6-29.
//  Copyright (c) 2015年 lanou3g.com 蓝欧科技. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, HTTPStyle) {
    HTTP,
    JSON,
    XML
};

typedef NS_ENUM(NSInteger, RequestBodyStyle) {
    BodyHTTP,
    BodyJOSN
};

@interface HTTPTool : NSObject
/**
 *  网络请求GET
 *
 *  @param url     请求url
 *  @param body    网络请求携带的Body
 *  @param style   请求返回的数据格式
 *  @param success 成功后调用的Block
 *  @param failure 失败后调用的Block
 */
+ (void)get:(NSString *)url
       body:(id)body
  httpResultStyle:(HTTPStyle)style
    success:(void (^)(id result))success
    failure:(void (^)(NSError *error))failure;

+ (void)get1:(NSString *)url
       body:(id)body
httpResultStyle:(HTTPStyle)style
    success:(void (^)(id result))success
    failure:(void (^)(NSError *error))failure;

/**
 *  网络请求POST
 *
 *  @param url       请求url
 *  @param body      网络数据携带的Body
 *  @param style     请求返回的数据格式
 *  @param bodyStyle Body的格式
 *  @param success   成功后调用的Block
 *  @param failure   失败后调用的Block
 */
+ (void)post:(NSString *)url
       body:(id)body
httpResultStyle:(HTTPStyle)style
requestBodyStyle:(RequestBodyStyle)bodyStyle
    success:(void (^)(id result))success
    failure:(void (^)(NSError *error))failure;

@end
